/**
 * Created by Administrator on 2017/10/17.
 */


//方式一
//连接mongoose模块
// var mongoose = require('mongoose');
// //连接分页插件
// var mongoosePaginate = require('mongoose-paginate')
// var Schema = mongoose.Schema;//调用模块方法,建立数据模型
// var UserSchema= new Schema({
//     name:String,
//     password:String,
//     data:{type:Date,default:Date.now}
// });
// UserSchema.plugin(mongoosePaginate);//调用分页插件
// module.exports=mongoose.model("User",UserSchema,"user");



//方式二
var mongoose = require('mongoose');
//连接分页插件
var mongoosePaginate = require('mongoose-paginate')
var schema = mongoose.Schema;//调用模块方法,建立数据模型
var schema= new mongoose.Schema({
    name:String,
    password:String,
    data:{type:Date,default:Date.now}
});
schema.plugin(mongoosePaginate);//调用分页插件
var User=mongoose.model("User",schema,"user")
module.exports=User;




























